package mypractice;

public class Work6 {
    public static void main(String[] args) {
        Student[] students=new Student[5];
        int i;
        for(i=0;i<5;i++){
            students[i]=new Student();
        }
        for(i=0;i<5;i++){
            students[i].print();
        }

        //平均值
        Work6.average(students);
    }

    public static void average(Student[] students){
        int i;
        int sum=0;
        for(i=0;i<5;i++){
            sum+=students[i].score;
        }
        System.out.println(sum/5);
    }

}

class Student{
    String name;
    int stuld;
    String gender;
    int age;
    double score;


    public void print() {
        System.out.println("student name is"+this.name);
        System.out.println(this.stuld);
        System.out.println(this.gender);
        System.out.println(this.age);
        System.out.println(this.score);
    }

    public Student() {
    }

    public Student(String name, int stuld, String gender, int age, double score) {
        this.name = name;
        this.stuld = stuld;
        this.gender = gender;
        this.age = age;
        this.score = score;
    }
}
